home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / widget / nsIFilePicker.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  12KB  |  344 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIFilePicker.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIFilePicker_h__
  6. #define __gen_nsIFilePicker_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsILocalFile; /* forward declaration */
  18.  
  19. class nsIFileURL; /* forward declaration */
  20.  
  21. class nsIDOMWindow; /* forward declaration */
  22.  
  23. class nsISimpleEnumerator; /* forward declaration */
  24.  
  25.  
  26. /* starting interface:    nsIFilePicker */
  27. #define NS_IFILEPICKER_IID_STR "80faf095-c807-4558-a2cc-185ed70754ea"
  28.  
  29. #define NS_IFILEPICKER_IID \
  30.   {0x80faf095, 0xc807, 0x4558, \
  31.     { 0xa2, 0xcc, 0x18, 0x5e, 0xd7, 0x07, 0x54, 0xea }}
  32.  
  33. class NS_NO_VTABLE nsIFilePicker : public nsISupports {
  34.  public: 
  35.  
  36.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILEPICKER_IID)
  37.  
  38.   enum { modeOpen = 0 };
  39.  
  40.   enum { modeSave = 1 };
  41.  
  42.   enum { modeGetFolder = 2 };
  43.  
  44.   enum { modeOpenMultiple = 3 };
  45.  
  46.   enum { returnOK = 0 };
  47.  
  48.   enum { returnCancel = 1 };
  49.  
  50.   enum { returnReplace = 2 };
  51.  
  52.   enum { filterAll = 1 };
  53.  
  54.   enum { filterHTML = 2 };
  55.  
  56.   enum { filterText = 4 };
  57.  
  58.   enum { filterImages = 8 };
  59.  
  60.   enum { filterXML = 16 };
  61.  
  62.   enum { filterXUL = 32 };
  63.  
  64.   enum { filterApps = 64 };
  65.  
  66.   /**
  67.   * Initialize the file picker widget.  The file picker is not valid until this
  68.   * method is called.
  69.   *
  70.   * @param      parent   nsIDOMWindow parent.  This dialog will be dependent
  71.   *                      on this parent. parent must be non-null.
  72.   * @param      title    The title for the file widget
  73.   * @param      mode     load, save, or get folder
  74.   *
  75.   */
  76.   /* void init (in nsIDOMWindow parent, in AString title, in short mode); */
  77.   NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) = 0;
  78.  
  79.   /**
  80.   * Append to the  filter list with things from the predefined list
  81.   *
  82.   * @param      filters  mask of filters i.e. (filterAll | filterHTML)
  83.   *
  84.   */
  85.   /* void appendFilters (in long filterMask); */
  86.   NS_IMETHOD AppendFilters(PRInt32 filterMask) = 0;
  87.  
  88.   /**
  89.   * Add a filter
  90.   *
  91.   * @param      title    name of the filter
  92.   * @param      filter   extensions to filter -- semicolon and space separated
  93.   *
  94.   */
  95.   /* void appendFilter (in AString title, in AString filter); */
  96.   NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) = 0;
  97.  
  98.   /**
  99.   * The filename that should be suggested to the user as a default.
  100.   *
  101.   * @throws NS_ERROR_FAILURE on attempts to get
  102.   */
  103.   /* attribute AString defaultString; */
  104.   NS_IMETHOD GetDefaultString(nsAString & aDefaultString) = 0;
  105.   NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) = 0;
  106.  
  107.   /**
  108.   * The extension that should be associated with files of the type we
  109.   * want to work with.  On some platforms, this extension will be
  110.   * automatically appended to filenames the user enters, if needed.  
  111.   */
  112.   /* attribute AString defaultExtension; */
  113.   NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) = 0;
  114.   NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) = 0;
  115.  
  116.   /**
  117.   * The filter which is currently selected in the File Picker dialog
  118.   *
  119.   * @return Returns the index (0 based) of the selected filter in the filter list. 
  120.   */
  121.   /* attribute long filterIndex; */
  122.   NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) = 0;
  123.   NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) = 0;
  124.  
  125.   /**
  126.   * Set the directory that the file open/save dialog initially displays
  127.   *
  128.   * @param      displayDirectory  the name of the directory
  129.   *
  130.   */
  131.   /* attribute nsILocalFile displayDirectory; */
  132.   NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) = 0;
  133.   NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) = 0;
  134.  
  135.   /**
  136.   * Get the nsILocalFile for the file or directory.
  137.   *
  138.   * @return Returns the file currently selected
  139.   */
  140.   /* readonly attribute nsILocalFile file; */
  141.   NS_IMETHOD GetFile(nsILocalFile * *aFile) = 0;
  142.  
  143.   /**
  144.   * Get the nsIFileURL for the file or directory.
  145.   *
  146.   * @return Returns the file currently selected
  147.   */
  148.   /* readonly attribute nsIFileURL fileURL; */
  149.   NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) = 0;
  150.  
  151.   /**
  152.   * Get the enumerator for the selected files
  153.   * only works in the modeOpenMultiple mode
  154.   *
  155.   * @return Returns the files currently selected
  156.   */
  157.   /* readonly attribute nsISimpleEnumerator files; */
  158.   NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) = 0;
  159.  
  160.   /**
  161.   * Show File Dialog. The dialog is displayed modally.
  162.   *
  163.   * @return returnOK if the user selects OK, returnCancel if the user selects cancel
  164.   *
  165.   */
  166.   /* short show (); */
  167.   NS_IMETHOD Show(PRInt16 *_retval) = 0;
  168.  
  169. };
  170.  
  171. /* Use this macro when declaring classes that implement this interface. */
  172. #define NS_DECL_NSIFILEPICKER \
  173.   NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode); \
  174.   NS_IMETHOD AppendFilters(PRInt32 filterMask); \
  175.   NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter); \
  176.   NS_IMETHOD GetDefaultString(nsAString & aDefaultString); \
  177.   NS_IMETHOD SetDefaultString(const nsAString & aDefaultString); \
  178.   NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension); \
  179.   NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension); \
  180.   NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex); \
  181.   NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex); \
  182.   NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory); \
  183.   NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory); \
  184.   NS_IMETHOD GetFile(nsILocalFile * *aFile); \
  185.   NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL); \
  186.   NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles); \
  187.   NS_IMETHOD Show(PRInt16 *_retval); 
  188.  
  189. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  190. #define NS_FORWARD_NSIFILEPICKER(_to) \
  191.   NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) { return _to Init(parent, title, mode); } \
  192.   NS_IMETHOD AppendFilters(PRInt32 filterMask) { return _to AppendFilters(filterMask); } \
  193.   NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) { return _to AppendFilter(title, filter); } \
  194.   NS_IMETHOD GetDefaultString(nsAString & aDefaultString) { return _to GetDefaultString(aDefaultString); } \
  195.   NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) { return _to SetDefaultString(aDefaultString); } \
  196.   NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) { return _to GetDefaultExtension(aDefaultExtension); } \
  197.   NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) { return _to SetDefaultExtension(aDefaultExtension); } \
  198.   NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) { return _to GetFilterIndex(aFilterIndex); } \
  199.   NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) { return _to SetFilterIndex(aFilterIndex); } \
  200.   NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) { return _to GetDisplayDirectory(aDisplayDirectory); } \
  201.   NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) { return _to SetDisplayDirectory(aDisplayDirectory); } \
  202.   NS_IMETHOD GetFile(nsILocalFile * *aFile) { return _to GetFile(aFile); } \
  203.   NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) { return _to GetFileURL(aFileURL); } \
  204.   NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) { return _to GetFiles(aFiles); } \
  205.   NS_IMETHOD Show(PRInt16 *_retval) { return _to Show(_retval); } 
  206.  
  207. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  208. #define NS_FORWARD_SAFE_NSIFILEPICKER(_to) \
  209.   NS_IMETHOD Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(parent, title, mode); } \
  210.   NS_IMETHOD AppendFilters(PRInt32 filterMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendFilters(filterMask); } \
  211.   NS_IMETHOD AppendFilter(const nsAString & title, const nsAString & filter) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendFilter(title, filter); } \
  212.   NS_IMETHOD GetDefaultString(nsAString & aDefaultString) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultString(aDefaultString); } \
  213.   NS_IMETHOD SetDefaultString(const nsAString & aDefaultString) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultString(aDefaultString); } \
  214.   NS_IMETHOD GetDefaultExtension(nsAString & aDefaultExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultExtension(aDefaultExtension); } \
  215.   NS_IMETHOD SetDefaultExtension(const nsAString & aDefaultExtension) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultExtension(aDefaultExtension); } \
  216.   NS_IMETHOD GetFilterIndex(PRInt32 *aFilterIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilterIndex(aFilterIndex); } \
  217.   NS_IMETHOD SetFilterIndex(PRInt32 aFilterIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilterIndex(aFilterIndex); } \
  218.   NS_IMETHOD GetDisplayDirectory(nsILocalFile * *aDisplayDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDisplayDirectory(aDisplayDirectory); } \
  219.   NS_IMETHOD SetDisplayDirectory(nsILocalFile * aDisplayDirectory) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDisplayDirectory(aDisplayDirectory); } \
  220.   NS_IMETHOD GetFile(nsILocalFile * *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFile(aFile); } \
  221.   NS_IMETHOD GetFileURL(nsIFileURL * *aFileURL) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileURL(aFileURL); } \
  222.   NS_IMETHOD GetFiles(nsISimpleEnumerator * *aFiles) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFiles(aFiles); } \
  223.   NS_IMETHOD Show(PRInt16 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Show(_retval); } 
  224.  
  225. #if 0
  226. /* Use the code below as a template for the implementation class for this interface. */
  227.  
  228. /* Header file */
  229. class nsFilePicker : public nsIFilePicker
  230. {
  231. public:
  232.   NS_DECL_ISUPPORTS
  233.   NS_DECL_NSIFILEPICKER
  234.  
  235.   nsFilePicker();
  236.  
  237. private:
  238.   ~nsFilePicker();
  239.  
  240. protected:
  241.   /* additional members */
  242. };
  243.  
  244. /* Implementation file */
  245. NS_IMPL_ISUPPORTS1(nsFilePicker, nsIFilePicker)
  246.  
  247. nsFilePicker::nsFilePicker()
  248. {
  249.   /* member initializers and constructor code */
  250. }
  251.  
  252. nsFilePicker::~nsFilePicker()
  253. {
  254.   /* destructor code */
  255. }
  256.  
  257. /* void init (in nsIDOMWindow parent, in AString title, in short mode); */
  258. NS_IMETHODIMP nsFilePicker::Init(nsIDOMWindow *parent, const nsAString & title, PRInt16 mode)
  259. {
  260.     return NS_ERROR_NOT_IMPLEMENTED;
  261. }
  262.  
  263. /* void appendFilters (in long filterMask); */
  264. NS_IMETHODIMP nsFilePicker::AppendFilters(PRInt32 filterMask)
  265. {
  266.     return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268.  
  269. /* void appendFilter (in AString title, in AString filter); */
  270. NS_IMETHODIMP nsFilePicker::AppendFilter(const nsAString & title, const nsAString & filter)
  271. {
  272.     return NS_ERROR_NOT_IMPLEMENTED;
  273. }
  274.  
  275. /* attribute AString defaultString; */
  276. NS_IMETHODIMP nsFilePicker::GetDefaultString(nsAString & aDefaultString)
  277. {
  278.     return NS_ERROR_NOT_IMPLEMENTED;
  279. }
  280. NS_IMETHODIMP nsFilePicker::SetDefaultString(const nsAString & aDefaultString)
  281. {
  282.     return NS_ERROR_NOT_IMPLEMENTED;
  283. }
  284.  
  285. /* attribute AString defaultExtension; */
  286. NS_IMETHODIMP nsFilePicker::GetDefaultExtension(nsAString & aDefaultExtension)
  287. {
  288.     return NS_ERROR_NOT_IMPLEMENTED;
  289. }
  290. NS_IMETHODIMP nsFilePicker::SetDefaultExtension(const nsAString & aDefaultExtension)
  291. {
  292.     return NS_ERROR_NOT_IMPLEMENTED;
  293. }
  294.  
  295. /* attribute long filterIndex; */
  296. NS_IMETHODIMP nsFilePicker::GetFilterIndex(PRInt32 *aFilterIndex)
  297. {
  298.     return NS_ERROR_NOT_IMPLEMENTED;
  299. }
  300. NS_IMETHODIMP nsFilePicker::SetFilterIndex(PRInt32 aFilterIndex)
  301. {
  302.     return NS_ERROR_NOT_IMPLEMENTED;
  303. }
  304.  
  305. /* attribute nsILocalFile displayDirectory; */
  306. NS_IMETHODIMP nsFilePicker::GetDisplayDirectory(nsILocalFile * *aDisplayDirectory)
  307. {
  308.     return NS_ERROR_NOT_IMPLEMENTED;
  309. }
  310. NS_IMETHODIMP nsFilePicker::SetDisplayDirectory(nsILocalFile * aDisplayDirectory)
  311. {
  312.     return NS_ERROR_NOT_IMPLEMENTED;
  313. }
  314.  
  315. /* readonly attribute nsILocalFile file; */
  316. NS_IMETHODIMP nsFilePicker::GetFile(nsILocalFile * *aFile)
  317. {
  318.     return NS_ERROR_NOT_IMPLEMENTED;
  319. }
  320.  
  321. /* readonly attribute nsIFileURL fileURL; */
  322. NS_IMETHODIMP nsFilePicker::GetFileURL(nsIFileURL * *aFileURL)
  323. {
  324.     return NS_ERROR_NOT_IMPLEMENTED;
  325. }
  326.  
  327. /* readonly attribute nsISimpleEnumerator files; */
  328. NS_IMETHODIMP nsFilePicker::GetFiles(nsISimpleEnumerator * *aFiles)
  329. {
  330.     return NS_ERROR_NOT_IMPLEMENTED;
  331. }
  332.  
  333. /* short show (); */
  334. NS_IMETHODIMP nsFilePicker::Show(PRInt16 *_retval)
  335. {
  336.     return NS_ERROR_NOT_IMPLEMENTED;
  337. }
  338.  
  339. /* End of implementation class template. */
  340. #endif
  341.  
  342.  
  343. #endif /* __gen_nsIFilePicker_h__ */
  344.